<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->string('avatar')->nullable()->comment('用户头像');
            $table->string('wechat_id')->default(0)->comment('微信ID');
            $table->boolean('member')->default(0)->comment('是否为联盟会员,0:普通会员，1:联盟会员');
            $table->string('mobile');
            $table->string('email')->unique();
            $table->timestamp('email_verified_at')->nullable();
            $table->string('password')->default('admin888');
            $table->boolean('is_admin')->default(0)->comment('是否为管理员');
            $table->json('approve')->nullable()->comment('审批信息');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
